<template>
	<div>
		<el-dialog title="流程设计" :close-on-click-modal="false" v-model="visible" width="95%" @close="refreshEmit" >
			<iframe id="wf" width="100%" height="800px"  crossorigin   :src='this.url' style="border: 1px;border-color: #1a1a1a"></iframe>
		</el-dialog>
	</div>
</template>
<script lang="ts">
	import { toRefs, reactive, defineComponent } from 'vue'
	import {workflowApi} from '/@/api/workflowapi'
	export default defineComponent ({
		setup(props, ctx) {
			const state = reactive({
				visible: false,
				url:"",
				id:"",
				creatFlag:false
			})
			// 打开弹窗
			const openDialog = (id: string, creatFlag: boolean) => {
				state.id=id
				state.visible = true
				state.creatFlag=creatFlag
				state.url = import.meta.env.VITE_API_URL + workflowApi().serverContextPath + `/model/toModelerPage/`+id
			}
			const refreshEmit = () => {
				closeDialog()
				ctx.emit('refreshDataList')
			}
			// 关闭弹窗
			const closeDialog = () => {
				state.visible = false;
			}
			return{
				openDialog,
				closeDialog,
				refreshEmit,
				...toRefs(state),
			}
		}
	})
</script>

<style>

</style>